package com.forcht.ioc.dynamicproxy;

import java.lang.reflect.Proxy;

/**
 * Created by forcht on 2018/4/20.
 */
public class TestProxy {

    public static void main(String[] args) {
        Subject subject=new RealSubject();
        Subject proxy = (Subject)Proxy.newProxyInstance(subject.getClass().getClassLoader(),
                subject.getClass().getInterfaces(), new MyProxy(subject));
        proxy.hello();
        proxy.send("aaa");

    }
}
